<div class="SipeiStat border_3 pb20 centered back_bgf mt20">   
    <h1 class="clearfix pl20 mb20 fonts_18 height40 fontc_444 fontw_normal back_bgfd"><?php echo $this->title; ?></h1>
    
    <div id="container" style="width:90%; margin:0 auto;"></div>
    <?php 
        $photo_name = array('优秀率','及格率','低分率');
        $photo_name_list = json_encode($photo_name);  ?>
        <table class="fontc_666 height32">
            <thead class="back_bgf5 fontc_999">
                <tr>
                    <th width="90" align="center" class="border_d">
                        <?php echo $examInfo['exam_name']; ?>
                    </th>
                    <th width="87" align="center" class="border_d"></th>
                    <?php echo $table[0]; ?>
                </tr>
            </thead>
            <tbody class="fontc_444">
                <tr>
                    <td align="center" class="border_d">学校</td>
                    <td align="center" class="border_d">实考人数</td>
                    <td align="center" class="border_d">总分</td>
                    <td align="center" class="border_d"></td>
                    <td align="center" class="border_d"></td>
                    <td align="center" class="border_d"></td>
                    <?php echo $table[1]; ?>
                </tr>
                <tr>
                    <td align="center" class="border_d"></td>
                    <td align="center" class="border_d"></td>
                    <?php echo $table[2]; ?>
                </tr>
                <?php 
                
                $photo_data = $x = array();
                
                if(!empty($point)):
                    foreach($point as $key => $value):    ?>
                <tr>
                    <td align="center" class="border_d"><?php echo $schoolObject[$key]; ?></td>
                    <td align="center" class="border_d"><?php echo $value['people'];  ?></td>
                    <td align="center" class="border_d"><?php echo sprintf('%.2f', $value['point']/$value['people']); ?></td>
                    <td align="center" class="border_d">
                    <?php 
                        $t1 = sprintf('%.2f', $value['type1']/3);
                        $tt1 = sprintf('%.2f', $t1/$value['people']); $x[] = (float)$tt1;
                        echo $tt1; ?>
                    </td>
                    <td align="center" class="border_d">
                    <?php 
                        $t2 = sprintf('%.2f', $value['type2']/3);
                        $tt2  = sprintf('%.2f', $t2/$value['people']); $x[] = (float)$tt2;
                        echo $tt2; ?>
                    </td>
                    <td align="center" class="border_d">
                    <?php 
                        $t3 = sprintf('%.2f', $value['type3']/3);
                        $tt3 = sprintf('%.2f', $t3/$value['people']); $x[] = (float)$tt3;
                        echo $tt3;
                        
                        $t_array['name'] = '总分';
                        $t_array['data'] = $x;
                        $photo_data[] = $t_array; //图形显示数据
                        ?>
                    </td>
                    <?php 
                    if(isset($value['subject'])):
                        $xt = array();
                        foreach($value['subject'] as $sks => $sVal): $xx = array(); ?>
                    <td align="center" class="border_d">
                        <?php 
                        echo sprintf('%.2f', $sVal['point']/$value['people']);   ?>
                    </td>
                    <td align="center" class="border_d">
                        <?php 
                        echo $t1 = sprintf('%.2f', $sVal['type1']/$value['people']);
                        $xx[] = (float)$t1; ?>
                    </td>
                    <td align="center" class="border_d">
                        <?php 
                        echo $t2 = sprintf('%.2f', $sVal['type2']/$value['people']);
                        $xx[] = (float)$t2; ?>
                    </td>
                    <td align="center" class="border_d">
                        <?php 
                        echo $t3 = sprintf('%.2f', $sVal['type3']/$value['people']);
                        $xx[] = (float)$t3;
                        
                        $t_arr['name'] = $subjectObject[$sks]['subject_name'];
                        $t_arr['data'] = $xx;
                        $photo_data[] = $t_arr; ?>
                    </td>
                    <?php 
                        endforeach;
                    endif; ?>
                </tr>
                <?php 
                    endforeach;
                 endif; ?>
            </tbody>
        </table>    
        <div class="clearfix pt15 pb10 pl20"><input type="button" value="导出至Excel" class="b_a_n border_3 back_bgfb w80 height32 fontc_FFF fonts_12"></div>
</div>
<?php  $photo_data_list = json_encode($photo_data); ?>
<script type="text/javascript">
    function charts_line(type, categories, data) {
        $('#container').highcharts({
            title: {
                text: '成绩统计',
                x: 0 //
            },
            subtitle: {
                text: type,
                x: 0
            },
            xAxis: {
                categories: categories
            },
            yAxis: {
                title: {
                    text: ''
                },
                plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#808080'
                }]
            },
            tooltip: {
                valueSuffix: '人'
            },
            credits: {
                text: '',
                href: 'http://www.example.com'
            },
            series: data
        });
    }
    $(function() {
        var type = '（分数段）',
            categories = <?php echo $photo_name_list; ?>,
            data = <?php echo $photo_data_list; ?>;
        charts_line(type, categories, data);
    });
</script>